% TEST_ID: LANG-EXPAND-0101
% CATEGORY: language/string
% 测试 string 的 比较
function test_string_compare()
s1 = "abc";
s2 = "ab";
tf = s1 > s2;
assert(tf == true);
tf = s1 >= s2;
assert(tf == true);
tf = s1 < s2;
assert(tf == false);
tf = s1 <= s2;
assert(tf == false);

s1 = "abc";
s2 = "abc";
tf = s1 > s2;
assert(tf == false);
tf = s1 >= s2;
assert(tf == true);
tf = s1 < s2;
assert(tf == false);
tf = s1 <= s2;
assert(tf == true);


s1 = ["abc", "def"];
s2 = ["aaa", "dff"];
tf = s1 > s2;
assert(isequal(tf, [true, false]));
tf = s1 >= s2;
assert(isequal(tf, [true, false]));
tf = s1 < s2;
assert(isequal(tf, [false, true]));
tf = s1 <= s2;
assert(isequal(tf, [false, true]));

% 隐式拓展
s1 = ["abc", "def"; "ghi", "jkl"];
s2 = ["aaa", "dff"];
tf = s1 > s2;
assert(isequal(tf, [true, false; true, true]));
tf = s1 >= s2;
assert(isequal(tf, [true, false; true, true]));
tf = s1 < s2;
assert(isequal(tf, [false, true; false, false]));
tf = s1 <= s2;
assert(isequal(tf, [false, true; false, false]));

% 隐式拓展
s1 = ["abc", "def"; "ghi", "jkl"];
s2 = ["aaa"; "dff"];
tf = s1 > s2;
assert(isequal(tf, [true, true; true, true]));
tf = s1 >= s2;
assert(isequal(tf, [true, true; true, true]));
tf = s1 < s2;
assert(isequal(tf, [false, false; false, false]));
tf = s1 <= s2;
assert(isequal(tf, [false, false; false, false]));
end